package gambletest;

public class Person {
	
	private long coins;
	
	public Person(long coinsNum) {
		this.coins = coinsNum;
	}
	
	/**
	 * 放入n个硬币到赌博机中
	 * @param n 	放入硬币数
	 * @param gb 	赌博机
	 * @return 		输赢情况:true 赢 false:输
	 */
	public boolean putInTo(long n, Gamble gb) {
		this.coins -= n;
		long retu = gb.putIn(n);
		this.coins += retu;
		return retu == 0 ? false : true;
	}
	
	@Override
	public String toString() {
		return "当前人物拥有金钱数:" + this.coins + "元";
	}
}
